﻿@{
    ViewBag.Title = "角色管理";
    ViewBag.Active = "/role";
    bool isSuperAdmin = (ViewData["IsSuperAdmin"] as bool?) == true;
}
@if (isSuperAdmin)
{
    <el-button class="hx-mb-2" type="primary" @@click="onAdd">添加角色</el-button>
}
<el-table :data="tableData" border style="width: 100%" :header-cell-style="{background:'#eef1f6',color:'#606266'}">
    <el-table-column prop="name" label="角色名称" width="180" header-align="center">
    </el-table-column>
    <el-table-column prop="description" label="说明"  header-align="center">
    </el-table-column>
    <el-table-column prop="creater" label="创建者" width="120" header-align="center">
    </el-table-column>
    <el-table-column prop="createTime" label="创建事件" width="180" header-align="center">
    </el-table-column>
    <el-table-column prop="enabled" label="状态" width="100" header-align="center" align="center">
        <template slot-scope="scope">
            <el-tag :type="scope.row.enabled === 'Y'?'success':'danger'" disable-transitions>
                {{scope.row.enabled==='Y' ? "启用":"禁用"}}
            </el-tag>
        </template>
    </el-table-column>
    <el-table-column fixed="right" label="操作" width="200" v-if="@(isSuperAdmin?"true":"false")" align="center">
        <template slot-scope="scope">
            <el-button size="mini" @@click="onEdit(scope.row)">编辑</el-button>
            <el-button type="danger" size="mini" @@click="handleDelete(scope.row)">删除</el-button>
        </template>
    </el-table-column>
</el-table>
<div class="hx-float-right">
    <el-pagination @@current-change="handleCurrentChange"
                   :current-page.sync="queryParam.pageIndex"
                   :page-size="queryParam.pageSize"
                   background
                   layout="total, prev, pager, next"
                   :total="totalCount">
    </el-pagination>
</div>

<partial name="~/Views/Role/AddOrUpdate.cshtml" />

@section scripts{
    <script src="~/vuejs/role.js"></script>
}

